<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>摄影管理员登录注册页面</title>

    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <style>
        header .col-md-3{background-color: #3a4144}
        header .col-md-9{background-color: #282d2f}
        header>div>div{height: 50px}
        section .col-md-3{
            background-color: #282d2f;
            padding: 100px 50px;
        }
        section .col-md-9{background-color: #3a4144}
        section>div>div{height: 1000px}
        .panel-default{
            background-color: rgba(0,0,0,0);
            border: 0;
            color: #eee
        }
        .panel-default>.panel-heading{
            background-color: rgba(0,0,0,0)
        }
        #accordion a{
            color: #eee;
        }
        tr>th{
            text-align: center;
        }
    </style>
</head>
<body>
<header>
    <div class="row" >
        <div class="col-md-3">
            <a href="/">
                <img  style="margin-left: 29px"
                        src="http://www.vrd.net.cn/vrd/images/logo.png" alt="">
            </a>
        </div>
        <div class="col-md-9" style="color: #eee;line-height: 50px">
            <span class="pull-right" style="font-size: 20px">
                <span>{{user.nick}}欢迎你!</span>
                <a href="" @click="logout()">退出登录</a>
            </span>
        </div>
    </div>
</header>
<section>
    <div class="row">
        <div class="col-md-3">
            <!--折叠开始-->
            <div class="panel-group" id="accordion">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a class="fa fa-user-circle-o" data-toggle="collapse" data-parent="#accordion"
                               href="#collapseOne">
                                用户管理
                            </a>
                        </h4>
                    </div>
                    <div id="collapseOne" class="panel-collapse collapse in">
                        <div class="panel-body">
                            <ul style="list-style-type: none">
                                <li><a href="#">用户列表</a></li>
                                <li><a href="#" @click="add()">添加用户</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4 class="panel-title">
                            <a class="fa fa-institution" data-toggle="collapse" data-parent="#accordion"
                               href="#">
                                热门影展管理
                            </a>
                        </h4>
                    </div>
                    <div id="collapseTwo" class="panel-collapse collapse">
                        <div class="panel-body">
                            <ul style="list-style-type: none">
                                <li><a href="">影展列表</a></li>
                                <li><a href="/exhibitionAdd.html">添加影展</a></li>
                            </ul>
                        </div>
                    </div>
                </div>

            </div>
            <!--折叠结束-->
        </div>
        <div class="col-md-9" style="color: #eee">
            <h2 class="page-header" style="color: #ffc600">欢迎访问影展后台管理系统</h2>
            <table border="1" width="70%" style="text-align: center">
                <caption>分类列表</caption>
                <tr>
                    <th >序号</th>
                    <th >影展标题</th>
                    <th >作者</th>
                    <th >影展内容</th>
                    <th >影展展示图片</th>
                    <th >创建时间</th>
                    <th >操作</th>
                </tr>
                <tr v-for="(e,i) in a_arr">
                    <td width="20px">{{i+1}}</td>
                    <td width="80px">{{e.title}}</td>
                    <td width="40px">{{e.author}}</td>
                    <td>{{e.content}}</td>
                    <td>{{e.url}}</td>
                    <td>{{e.created}}</td>
                    <td>
                        <a href="#" @click="del(e.id)">删除</a>
                        <a href="#" @click="delAll(e.id)">删除所有</a>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</section>

<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
<!--引入vue-->
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<!--引入axios-->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
let vm= new Vue({
    el:"section",
    data:{
        a_arr:[]
    },
    created:function () {
        axios.get("/exh/selectAll").then(function (response) {
            vm.a_arr=response.data;
            //遍历所有作品并修改时间
            for (let p of vm.a_arr) {
                p.created = moment(p.created)
                    .format("YYYY-MM-DD HH:mm:ss");

            }
        })
    }
})
</script>
</body>
</html>